# Maintainer: Alexander Epaneshnikov <alex19ep@archlinux.org>
# Contributor: ny-a <nyaarch64 at gmail dot com>
# Contributor: Andrew Sun <adsun701@gmail.com>
# Contributor: Dmitrij D. Czarkoff <czarkoff@gmail.com>

pkgname=librem
pkgver=2.10.0
pkgrel=1
pkgdesc="portable library for real-time audio and video processing"
arch=('loong64' 'x86_64')
url="https://github.com/baresip/rem"
license=('BSD')
depends=(libre.so)
provides=(librem.so)
replaces=('rem')
conflicts=('rem')
source=("${pkgname}-${pkgver}.tar.gz"::"https://github.com/baresip/rem/archive/refs/tags/v$pkgver.tar.gz"
        "rem-flags.patch")
sha256sums=('82d417f9ece6cafdbfb1e342cf1c7cf4390136578dd7c77b4c7995cbbf4792a0'
            '35b9b8cf8a8c85dc34986b579b002beb78f75feec6be37dd49ef665942299b02')

prepare() {
  cd rem-${pkgver}
  patch -Np1 -i "${srcdir}/rem-flags.patch"
}

build() {
  cd rem-${pkgver}
  make
}

package() {
  cd rem-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -vDm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
